using Coding4Fun.Phone.Controls;
using MicroMsg.Common.Event;
using MicroMsg.Common.Utils;
using MicroMsg.Plugin.DriftBottle.Scene;
using MicroMsg.Resource.@string;
using MicroMsg.UI.Page;
using MicroMsg.UI.Util;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.Windows.Threading;
namespace MicroMsg.UI.UserContrl
{
	public class WriteDriftBottleMsgCtrl : UserControl
	{
		public delegate void SendMsgHandler(MsgBottleKind sendMsgKind, WriteBtlOpKind opkind = WriteBtlOpKind.OpKind_Null);
		private const string TAG = "WriteDriftBottleMsgCtrl";
		public const int cNVoiceLoadDelayTime = 0;
		public const int cNLetterLoadDelayTime = 500;
		private const double cDElementToPosX = 365.0;
		private const double cDElementToPosY = 500.0;
		public const uint cNLoadLetterMsgDuaration = 1000u;
		private const double cDMsgObjectHeight = 100.0;
		private const double cDMsgObjectWidth = 35.0;
		public const uint cNLoadVoiceMsgDuaration = 1000u;
		private const double mDVoiceMsgLength = 240.0;
		public WriteDriftBottleMsgCtrl.SendMsgHandler mSendMsgHandler;
		private bool mBIsFirstLoaded = true;
		private EventWatcher mWatchContactListChange;
		private ApplicationBar mCurBar;
		private ApplicationBar mLetterStageBar;
		private IApplicationBarIconButton mBtnSendLetter;
		private bool bIsSend;
		private ApplicationBar mVoiceStageBar;
		private double mDElementFromPosX;
		private double mDElementFromPosY;
		private double mDElementFromH;
		private double mDElementFromW;
		private FrameworkElement mElementToLoadToBottle;
		public static uint cNLoadMsgDuaration = 1000u;
		private Storyboard mSbRecording;
		private uint cNRecordinterval = 1000u;
		private uint cNRecLightInterval = 500u;
		private uint cNMaxRecTime = 60000u;
		private double cDVoiceMsgMasLength = 360.0;
		private DispatcherTimer mRecordingTimer;
		private int mRecTimerCnt;
		private List<BitmapImage> mListImgsRecProg;
		private double mDMsgRecLength;
		private bool mBIsDrawedLines;
		private bool mbIsAskLoseBoxOn;
		internal Grid LayoutRoot;
		internal Grid gridBackBG;
		internal StackPanel panelRecordAniObjs;
		internal Rectangle rectTowerCover;
		internal Grid gridVoiceMsg;
		internal Border borderVoiceMsg;
		internal Rectangle rectVoiceMsg;
		internal Image imgVoiceMsgLight;
		internal Image imgVMsgCorner1;
		internal Image imgRecordProg;
		internal Grid canvasVoiceArea;
		internal Image imgVoiceHint;
		internal Button btnVoiceTalk;
		internal Image imgVoiceTalk;
		internal TextBlock txtPressBtnHint;
		internal Canvas canvasLetterArea;
		internal Image imgLetterPaper;
		internal Image imgLetterPaperWaterMark;
		internal TextBox txtIn;
		internal StackPanel panelLines;
		internal StackPanel panelSIP;
		internal StackPanel inputBk;
		internal RoundButton btnSwitchInputer;
		internal VoiceInputButton btnVoiceSend;
		private bool _contentLoaded;
		public WriteDriftBottleMsgCtrl(WriteDriftBottleMsgCtrl.SendMsgHandler sendMsgHandler)
		{
			this.InitializeComponent();
			this.mSendMsgHandler = sendMsgHandler;
			base.add_Loaded(new RoutedEventHandler(this.Control_Loaded));
			base.add_Unloaded(new RoutedEventHandler(this.Control_Unloaded));
		}
		private void Control_Loaded(object sender, RoutedEventArgs e)
		{
			Log.smethod_5("WriteDriftBottleMsgCtrl", "Control_Loaded");
			this.setBackKeyHandler();
			if (this.mBIsFirstLoaded)
			{
				this.mBIsFirstLoaded = false;
				DateTime now = DateTime.get_Now();
				if (now.get_Hour() < 6 || now.get_Hour() >= 18)
				{
					Shape arg_62_0 = this.rectTowerCover;
					SolidColorBrush solidColorBrush = new SolidColorBrush();
					solidColorBrush.set_Color(Color.FromArgb(255, 16, 20, 32));
					arg_62_0.set_Fill(solidColorBrush);
				}
				this.toVoiceStage();
			}
		}
		private void Control_Unloaded(object sender, RoutedEventArgs e)
		{
			Log.smethod_5("WriteDriftBottleMsgCtrl", "Control_Unloaded");
			this.unSetBackKeyHandler();
		}
		private void registerEvent()
		{
			if (this.mWatchContactListChange == null)
			{
				this.mWatchContactListChange = new EventWatcher(this, this, new EventHandlerDelegate(this.OnContactChange));
				EventCenter.registerEventWatcher(EventConst.ON_STORAGE_CONTACT_ADD, this.mWatchContactListChange);
			}
		}
		private void unRegisterEvent()
		{
			if (this.mWatchContactListChange != null)
			{
				EventCenter.removeEventWatcher(EventConst.ON_STORAGE_CONTACT_ADD, this.mWatchContactListChange);
				this.mWatchContactListChange = null;
			}
		}
		private void OnContactChange(EventWatcher watcher, BaseEventArgs evtArgs)
		{
		}
		private void btnSwitchInputer_MouseLeave(object sender, MouseEventArgs e)
		{
		}
		private void btnSwitchInputer_Click(object sender, RoutedEventArgs e)
		{
			this.toLetterStage();
		}
		private void btnVoiceTalk_Click(object sender, RoutedEventArgs e)
		{
		}
		private void btnVoiceTalk_ManipulationStarted(object sender, ManipulationStartedEventArgs e)
		{
			this.mSendMsgHandler(MsgBottleKind.Bt_Null, WriteBtlOpKind.OpKind_WritingVoice);
			this.imgVoiceTalk.set_Source(new BitmapImage(new Uri("/Source/Plugin/DriftBottle/Resource/Img/SpeakButtonPressed.png", 2)));
			this.txtPressBtnHint.set_Text(strings.Float_Bottle_UnPress_Throw);
			this.startRecord();
			ThrowVoiceBottleService.doVoiceBottleSceneBegin();
		}
		private void startRecord()
		{
			this.hideVoiceHint();
			this.startRecordAni();
		}
		private void btnVoiceTalk_ManipulationCompleted(object sender, ManipulationCompletedEventArgs e)
		{
			this.mSendMsgHandler(MsgBottleKind.Bt_Null, WriteBtlOpKind.OpKind_FinishVoice);
			this.stopRecord();
		}
		private void recordTimeUp()
		{
			this.btnVoiceTalk.set_IsEnabled(false);
			this.stopRecord();
		}
		private void stopRecord()
		{
			this.txtPressBtnHint.set_Text(strings.Float_Bottle_Press_Talk);
			this.imgVoiceTalk.set_Source(new BitmapImage(new Uri("/Source/Plugin/DriftBottle/Resource/Img/SpeakButtonNormal.png", 2)));
			bool bIsVoiceOk;
			if (bIsVoiceOk = ThrowVoiceBottleService.doVoiceBottleSceneEnd())
			{
				this.canvasVoiceArea.set_Visibility(1);
				if (this.mSendMsgHandler != null)
				{
					this.mSendMsgHandler(MsgBottleKind.Bt_Voice, WriteBtlOpKind.OpKind_Null);
				}
			}
			this.stopRecord(bIsVoiceOk);
		}
		private void stopRecord(bool bIsVoiceOk)
		{
			if (!bIsVoiceOk)
			{
				this.showVoiceHint();
				this.stopRecordAni();
				this.panelRecordAniObjs.set_Visibility(1);
				this.btnVoiceTalk.set_IsEnabled(true);
				MessageBoxManager.ShowToast(strings.Float_Bottle_Message_TooShortForRecord, 2500, null, false);
				return;
			}
			this.stopRecordAni();
			this.showVoiceMsg();
			this.imgRecordProg.set_Visibility(1);
			this.startLoadVoiceMsgAni(this.gridVoiceMsg, 0u);
		}
		private void btnVoiceSend_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
		{
		}
		private void btnVoiceSend_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
		{
		}
		private void btnVoiceSend_MouseLeave(object sender, MouseEventArgs e)
		{
		}
		private void txtIn_TextChanged(object sender, TextChangedEventArgs e)
		{
			if (this.mBtnSendLetter == null)
			{
				return;
			}
			int arg_19_0 = this.txtIn.get_Text().get_Length();
		}
		private ApplicationBar setLetterAppBar()
		{
			if (this.mLetterStageBar != null)
			{
				this.setCurrPageAppBar(this.mLetterStageBar);
				return this.mLetterStageBar;
			}
			this.mLetterStageBar = new ApplicationBar();
			this.mLetterStageBar.set_IsMenuEnabled(true);
			this.mLetterStageBar.set_IsVisible(true);
			ApplicationBarIconButton applicationBarIconButton = new ApplicationBarIconButton(new Uri("/Resource/Img/Chat/voice.png", 2));
			applicationBarIconButton.set_Text(strings.Float_Bottle_SwitchToVoice);
			applicationBarIconButton.add_Click(new EventHandler(this.btnToVoiceStage_Click));
			this.mLetterStageBar.get_Buttons().Add(applicationBarIconButton);
			ApplicationBarIconButton applicationBarIconButton2 = new ApplicationBarIconButton(new Uri("/Source/Plugin/DriftBottle/Resource/Img/iconThrow.png", 2));
			applicationBarIconButton2.set_Text(strings.Float_Bottle_Throw_Button);
			applicationBarIconButton2.add_Click(new EventHandler(this.btnSend_Click));
			this.mLetterStageBar.get_Buttons().Add(applicationBarIconButton2);
			this.setCurrPageAppBar(this.mLetterStageBar);
			return this.mLetterStageBar;
		}
		private void btnToVoiceStage_Click(object sender, EventArgs e)
		{
			if (this.txtIn.get_Text().get_Length() > 0)
			{
				MMMessageBox mMMessageBox = MMMessageBox.Show(strings.Float_Bottle_Switch_Tip, "", true, strings.COM_Confirm, strings.COM_Cancel);
				mMMessageBox.ReturnEvent = new DlgReturnEvent(this.askMsgLoseHandlerForSwitch);
				this.mbIsAskLoseBoxOn = true;
				return;
			}
			this.toVoiceStage();
		}
		private void askMsgLoseHandlerForSwitch(DlgReturnEventArg dlgReturnEventArg_0)
		{
			this.mbIsAskLoseBoxOn = false;
			switch (MMMessageBox.GetUserClickResult(dlgReturnEventArg_0))
			{
			case 0:
				this.txtIn.set_Text("");
				this.toVoiceStage();
				break;
			case 1:
				break;
			default:
				return;
			}
		}
		private void btnSend_Click(object sender, EventArgs e)
		{
			string text = this.txtIn.get_Text();
			if (text != null && text.Trim().get_Length() >= 5)
			{
				if (this.mSendMsgHandler != null && !this.bIsSend)
				{
					this.bIsSend = true;
					this.btnVoiceSend.Focus();
					this.mSendMsgHandler(MsgBottleKind.Bt_Letter, WriteBtlOpKind.OpKind_Null);
					this.startLoadMsgAnimation(this.canvasLetterArea, 500u);
					ThrowVoiceBottleService.doTextBottleScene(this.txtIn.get_Text());
				}
				return;
			}
			MessageBoxManager.ShowToast(strings.Float_Bottle_Message_TooShortForWrite, 2500, null, false);
		}
		private ApplicationBar setVoiceAppBar()
		{
			if (this.mVoiceStageBar != null)
			{
				this.setCurrPageAppBar(this.mVoiceStageBar);
				return this.mVoiceStageBar;
			}
			this.mVoiceStageBar = new ApplicationBar();
			this.mVoiceStageBar.set_IsMenuEnabled(true);
			this.mVoiceStageBar.set_IsVisible(true);
			ApplicationBarIconButton applicationBarIconButton = new ApplicationBarIconButton(new Uri("/Resource/Img/Chat/messeage_icon.png", 2));
			applicationBarIconButton.set_Text(strings.Float_Bottle_SwitchToText);
			applicationBarIconButton.add_Click(new EventHandler(this.btnToLetterStage_Click));
			this.mVoiceStageBar.get_Buttons().Add(applicationBarIconButton);
			this.setCurrPageAppBar(this.mVoiceStageBar);
			return this.mVoiceStageBar;
		}
		private void btnToLetterStage_Click(object sender, EventArgs e)
		{
			this.toLetterStage();
		}
		private void setCurrPageAppBar(ApplicationBar tBar)
		{
			if (tBar == null)
			{
				return;
			}
			PhoneApplicationFrame phoneApplicationFrame = Application.get_Current().get_RootVisual() as PhoneApplicationFrame;
			BasePage basePage = phoneApplicationFrame.get_Content() as BasePage;
			if (basePage == null)
			{
				return;
			}
			basePage.set_ApplicationBar(tBar);
			basePage.setAppBarStyle(tBar);
			this.mCurBar = tBar;
		}
		private void toLetterStage()
		{
			this.drawLines(28.0, 400.0, 0.0, this.panelLines.get_MinHeight());
			this.canvasVoiceArea.set_Visibility(1);
			this.canvasLetterArea.set_Visibility(0);
			this.txtIn.Focus();
			this.setLetterAppBar();
		}
		private void toVoiceStage()
		{
			this.canvasVoiceArea.set_Visibility(0);
			this.canvasLetterArea.set_Visibility(1);
			this.setVoiceAppBar();
		}
		private void startLoadMsgAnimation(FrameworkElement elementToLoadToBottle, uint nStartTime = 0u)
		{
			if (elementToLoadToBottle == null)
			{
				return;
			}
			this.mElementToLoadToBottle = elementToLoadToBottle;
			Storyboard storyboard = new Storyboard();
			WriteDriftBottleMsgCtrl.cNLoadMsgDuaration = 1000u;
			uint duration = WriteDriftBottleMsgCtrl.cNLoadMsgDuaration;
			this.mElementToLoadToBottle.set_Visibility(0);
			CompositeTransform compositeTransform = new CompositeTransform();
			this.mElementToLoadToBottle.set_RenderTransform(compositeTransform);
			this.mElementToLoadToBottle.set_RenderTransformOrigin(new Point(0.5, 0.5));
			DoubleAnimation doubleAnimation = this.createAnimation(0.0, 180.0, compositeTransform, "Rotation", duration);
			storyboard.get_Children().Add(doubleAnimation);
			doubleAnimation = this.createAnimation(1.0, 0.03, compositeTransform, "ScaleX", duration);
			storyboard.get_Children().Add(doubleAnimation);
			doubleAnimation = this.createAnimation(1.0, 0.1, compositeTransform, "ScaleY", duration);
			storyboard.get_Children().Add(doubleAnimation);
			doubleAnimation = this.createAnimation(0.0, 150.0, compositeTransform, "CenterX", duration);
			storyboard.get_Children().Add(doubleAnimation);
			doubleAnimation = this.createAnimation(0.0, 250.0, compositeTransform, "CenterY", duration);
			storyboard.get_Children().Add(doubleAnimation);
			doubleAnimation = this.createAnimation(1.0, 0.0, this.mElementToLoadToBottle, "Opacity", 200u);
			doubleAnimation.set_BeginTime(new TimeSpan?(TimeSpan.FromMilliseconds(WriteDriftBottleMsgCtrl.cNLoadMsgDuaration - 200u)));
			storyboard.get_Children().Add(doubleAnimation);
			if (nStartTime != 0u)
			{
				storyboard.set_BeginTime(new TimeSpan?(TimeSpan.FromMilliseconds(nStartTime)));
			}
			storyboard.add_Completed(new EventHandler(this.sbLoadMsgAnimation_Completed));
			storyboard.Begin();
		}
		private void startLoadVoiceMsgAni(FrameworkElement elementToLoadToBottle, uint nStartTime = 0u)
		{
			if (elementToLoadToBottle == null)
			{
				return;
			}
			this.mElementToLoadToBottle = elementToLoadToBottle;
			Storyboard storyboard = new Storyboard();
			WriteDriftBottleMsgCtrl.cNLoadMsgDuaration = 1000u;
			uint duration = WriteDriftBottleMsgCtrl.cNLoadMsgDuaration;
			this.mElementToLoadToBottle.set_Visibility(0);
			CompositeTransform compositeTransform = new CompositeTransform();
			this.mElementToLoadToBottle.set_RenderTransform(compositeTransform);
			this.mElementToLoadToBottle.set_RenderTransformOrigin(new Point(0.5, 0.5));
			DoubleAnimation doubleAnimation = this.createAnimation(0.0, 90.0, compositeTransform, "Rotation", duration);
			storyboard.get_Children().Add(doubleAnimation);
			doubleAnimation = this.createAnimation(1.0, 0.03, compositeTransform, "ScaleX", duration);
			storyboard.get_Children().Add(doubleAnimation);
			doubleAnimation = this.createAnimation(1.0, 0.2, compositeTransform, "ScaleY", duration);
			storyboard.get_Children().Add(doubleAnimation);
			doubleAnimation = this.createAnimation(0.0, 87.0, compositeTransform, "CenterX", duration);
			storyboard.get_Children().Add(doubleAnimation);
			doubleAnimation = this.createAnimation(0.0, 280.0, compositeTransform, "CenterY", duration);
			storyboard.get_Children().Add(doubleAnimation);
			doubleAnimation = this.createAnimation(1.0, 0.0, this.mElementToLoadToBottle, "Opacity", 200u);
			doubleAnimation.set_BeginTime(new TimeSpan?(TimeSpan.FromMilliseconds(WriteDriftBottleMsgCtrl.cNLoadMsgDuaration - 200u)));
			storyboard.get_Children().Add(doubleAnimation);
			if (nStartTime != 0u)
			{
				storyboard.set_BeginTime(new TimeSpan?(TimeSpan.FromMilliseconds(nStartTime)));
			}
			storyboard.add_Completed(new EventHandler(this.sbLoadMsgAnimation_Completed));
			storyboard.Begin();
		}
		private void sbLoadMsgAnimation_Completed(object sender, EventArgs e)
		{
			if (this.mElementToLoadToBottle == null)
			{
				return;
			}
			this.mElementToLoadToBottle.set_Visibility(1);
		}
		private void startRecordAni()
		{
			this.panelRecordAniObjs.set_Visibility(0);
			this.rectTowerCover.set_Visibility(0);
			this.imgVoiceMsgLight.set_Width(240.0);
			this.rectVoiceMsg.set_Width(240.0);
			this.mSbRecording = new Storyboard();
			uint num = this.cNRecLightInterval;
			DoubleAnimation doubleAnimation = this.createAnimation(0.0, 1.0, this.imgVoiceMsgLight, "Opacity", num * 3u);
			doubleAnimation.set_AutoReverse(true);
			doubleAnimation.set_RepeatBehavior(RepeatBehavior.get_Forever());
			this.mSbRecording.get_Children().Add(doubleAnimation);
			doubleAnimation = this.createAnimation(1.0, 0.6, this.gridVoiceMsg, "Opacity", num * 3u);
			doubleAnimation.set_AutoReverse(true);
			doubleAnimation.set_RepeatBehavior(RepeatBehavior.get_Forever());
			this.mSbRecording.get_Children().Add(doubleAnimation);
			this.mSbRecording.Begin();
			this.mRecordingTimer = new DispatcherTimer();
			this.mRecordingTimer.set_Interval(TimeSpan.FromMilliseconds(this.cNRecordinterval));
			this.mRecordingTimer.add_Tick(new EventHandler(this.mRecordingTimer_Tick));
			this.mRecTimerCnt = 0;
			this.mRecordingTimer.Start();
		}
		private BitmapImage getImgRecProg(int nIndex)
		{
			if (this.mListImgsRecProg == null)
			{
				this.mListImgsRecProg = new List<BitmapImage>();
				for (int i = 0; i < 10; i++)
				{
					BitmapImage bitmapImage = new BitmapImage(new Uri("/Source/Plugin/DriftBottle/Resource/Img/bottleRecordingSignal00" + i + ".png", 2));
					this.mListImgsRecProg.Add(bitmapImage);
				}
				this.mListImgsRecProg.Add(new BitmapImage(new Uri("/Source/Plugin/DriftBottle/Resource/Img/bottleRecordingSignal010.png", 2)));
			}
			if (nIndex >= 0 && nIndex < this.mListImgsRecProg.get_Count())
			{
				return this.mListImgsRecProg.get_Item(nIndex);
			}
			return null;
		}
		private void mRecordingTimer_Tick(object sender, EventArgs e)
		{
			this.mRecTimerCnt++;
			if ((ulong)this.cNRecordinterval * (ulong)((long)this.mRecTimerCnt) >= (ulong)this.cNMaxRecTime)
			{
				this.mRecTimerCnt = 0;
				this.recordTimeUp();
				this.stopRecordAni();
				return;
			}
			int nIndex = this.mRecTimerCnt % 11;
			this.imgRecordProg.set_Source(this.getImgRecProg(nIndex));
		}
		private void stopRecordAni()
		{
			if (this.mSbRecording != null)
			{
				this.mSbRecording.Stop();
				this.mSbRecording = null;
				this.rectTowerCover.set_Visibility(1);
			}
			this.imgVoiceMsgLight.set_Opacity(0.0);
			if (this.mRecordingTimer != null)
			{
				this.mDMsgRecLength = this.rectVoiceMsg.get_ActualWidth();
				this.mRecordingTimer.Stop();
				this.mRecordingTimer = null;
			}
			this.mRecTimerCnt = 0;
		}
		private DoubleAnimation createAnimation(double from, double double_0, DependencyObject target, string property, uint duration)
		{
			new Storyboard();
			DoubleAnimation doubleAnimation = new DoubleAnimation();
			doubleAnimation.set_From(new double?(from));
			doubleAnimation.set_To(new double?(double_0));
			doubleAnimation.set_Duration(TimeSpan.FromMilliseconds(duration));
			Storyboard.SetTarget(doubleAnimation, target);
			Storyboard.SetTargetProperty(doubleAnimation, new PropertyPath(property, new object[0]));
			return doubleAnimation;
		}
		private void hideVoiceHint()
		{
			this.imgVoiceHint.set_Visibility(1);
		}
		private void showVoiceHint()
		{
			this.imgVoiceHint.set_Visibility(0);
		}
		private void showVoiceMsg()
		{
			this.rectVoiceMsg.set_Fill(new SolidColorBrush(Color.FromArgb(255, 44, 157, 220)));
			this.rectVoiceMsg.set_Width(this.mDMsgRecLength);
			this.imgVMsgCorner1.set_Source(new BitmapImage(new Uri("/Source/Plugin/DriftBottle/Resource/Img/VoiceIcon2.png", 2)));
		}
		private void drawLines(double nLineHeight, double nLineWidth, double nContentHeight, double nMinHeight)
		{
		}
		private void setBackKeyHandler()
		{
			BasePage rootPage = ToolFunction.GetRootPage();
			if (rootPage == null)
			{
				return;
			}
			rootPage.add_BackKeyPress(new EventHandler<CancelEventArgs>(this.page_BackKeyPress));
		}
		private void unSetBackKeyHandler()
		{
			BasePage rootPage = ToolFunction.GetRootPage();
			if (rootPage == null)
			{
				return;
			}
			rootPage.remove_BackKeyPress(new EventHandler<CancelEventArgs>(this.page_BackKeyPress));
		}
		private void page_BackKeyPress(object sender, CancelEventArgs e)
		{
			if (this.mbIsAskLoseBoxOn)
			{
				return;
			}
			if (this.txtIn.get_Text().get_Length() > 0)
			{
				MMMessageBox mMMessageBox = MMMessageBox.Show(strings.Float_Bottle_Switch_Tip, "", true, strings.COM_Confirm, strings.COM_Cancel);
				mMMessageBox.ReturnEvent = new DlgReturnEvent(this.askMsgLoseHandlerForBack);
				e.set_Cancel(true);
				this.mbIsAskLoseBoxOn = true;
				return;
			}
			if (this.mSendMsgHandler != null)
			{
				this.mSendMsgHandler(MsgBottleKind.Bt_Null, WriteBtlOpKind.OpKind_Null);
			}
		}
		private void askMsgLoseHandlerForBack(DlgReturnEventArg dlgReturnEventArg_0)
		{
			this.mbIsAskLoseBoxOn = false;
			switch (MMMessageBox.GetUserClickResult(dlgReturnEventArg_0))
			{
			case 0:
				if (this.mSendMsgHandler != null)
				{
					this.mSendMsgHandler(MsgBottleKind.Bt_Null, WriteBtlOpKind.OpKind_Null);
				}
				break;
			case 1:
				break;
			default:
				return;
			}
		}
		[DebuggerNonUserCode]
		public void InitializeComponent()
		{
			if (this._contentLoaded)
			{
				return;
			}
			this._contentLoaded = true;
			Application.LoadComponent(this, new Uri("/MicroMsg;component/Source/Plugin/DriftBottle/UI/WriteDriftBottleMsgCtrl.xaml", 2));
			this.LayoutRoot = (Grid)base.FindName("LayoutRoot");
			this.gridBackBG = (Grid)base.FindName("gridBackBG");
			this.panelRecordAniObjs = (StackPanel)base.FindName("panelRecordAniObjs");
			this.rectTowerCover = (Rectangle)base.FindName("rectTowerCover");
			this.gridVoiceMsg = (Grid)base.FindName("gridVoiceMsg");
			this.borderVoiceMsg = (Border)base.FindName("borderVoiceMsg");
			this.rectVoiceMsg = (Rectangle)base.FindName("rectVoiceMsg");
			this.imgVoiceMsgLight = (Image)base.FindName("imgVoiceMsgLight");
			this.imgVMsgCorner1 = (Image)base.FindName("imgVMsgCorner1");
			this.imgRecordProg = (Image)base.FindName("imgRecordProg");
			this.canvasVoiceArea = (Grid)base.FindName("canvasVoiceArea");
			this.imgVoiceHint = (Image)base.FindName("imgVoiceHint");
			this.btnVoiceTalk = (Button)base.FindName("btnVoiceTalk");
			this.imgVoiceTalk = (Image)base.FindName("imgVoiceTalk");
			this.txtPressBtnHint = (TextBlock)base.FindName("txtPressBtnHint");
			this.canvasLetterArea = (Canvas)base.FindName("canvasLetterArea");
			this.imgLetterPaper = (Image)base.FindName("imgLetterPaper");
			this.imgLetterPaperWaterMark = (Image)base.FindName("imgLetterPaperWaterMark");
			this.txtIn = (TextBox)base.FindName("txtIn");
			this.panelLines = (StackPanel)base.FindName("panelLines");
			this.panelSIP = (StackPanel)base.FindName("panelSIP");
			this.inputBk = (StackPanel)base.FindName("inputBk");
			this.btnSwitchInputer = (RoundButton)base.FindName("btnSwitchInputer");
			this.btnVoiceSend = (VoiceInputButton)base.FindName("btnVoiceSend");
		}
	}
}
